sortlistmodel: Replace with an array-based model
authorBenjamin Otte <otte@redhat.com>
Thu, 16 Jul 2020 23:56:18 +0000 (01:56 +0200)
committerBenjamin Otte <otte@redhat.com>
Wed, 22 Jul 2020 12:04:40 +0000 (14:04 +0200)
commite807fc3be0785fb4d4efdb92a0901344c77d2503
tree25b2f6de2ceb283efb88c9656a995d1b54833eae
parentb67ffe96504bcf5c04a8413c94069385007d568a
sortlistmodel: Replace with an array-based model

This is the dumbest possible sortmodel using an array:
Just grab all the items, put them in the array, qsort() the array.

Some benchmarks (setting a new model):

  125,000 items - old: 549ms
                  new: 115ms
  250,000 items - new: 250ms

This performance can not be kept for simple additions and removals
though.
gtk/gtksortlistmodel.c